Skip to content

Lower precision in effective token rendering functions#24216

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/lower-precision-tokens-rendering
Closed

Lower precision in effective token rendering functions#24216
Copilot wants to merge 2 commits intomainfrom
copilot/lower-precision-tokens-rendering

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 3, 2026

Effective tokens are computed estimates (weighted token counts × model multipliers), not exact values. Displaying results with unnecessary precision implies false accuracy.

Changes

  • formatET (JS) — round values in [10, 1000) to nearest 10; values < 10 remain exact; K range unchanged; M range rounded to nearest whole M
  • formatTokens (Go) — same rounding applied throughout all ranges
Before → After
"42"    → "40"
"123"   → "120"
"900"   → "900"   (multiples of 10 unaffected)
"999"   → "1K"    (rounds up across threshold)
"1.2K"  → "1.2K"  (K range unchanged)
"1.2M"  → "1M"    (M range rounded to nearest whole M)
"7.8M"  → "8M"
"12.3M" → "12M"

@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented Apr 3, 2026

@copilot range is common around 1M - 10M

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 3, 2026

@copilot range is common around 1M - 10M

Good point. M-range values now round to the nearest whole million (e.g. "1.2M" → "1M", "7.8M" → "8M"), matching the precision level appropriate for the common 1M–10M range. Committed in 487bb47.

Copilot AI requested a review from pelikhan April 3, 2026 02:38
@pelikhan pelikhan closed this Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants